<div class = "order_form">
	<%= error_messages_for 'order' %>

	<%# the form for the Order.new created in the store controller checkout action.  This view is what Rails will draw when one picks the checkout action. %>
	<% form_for :order, :url => {:action => :save_order} do |form| %>
	<fieldset>
		<legend>Please Enter Your Details</legend>

		<div>
			<%= form.label :firstName, "First Name:" %>
			<%= form.text_field :firstName, :size => 23, :default => @user.firstName %>
		</div>
		<%= clear_floats %>
		<div>
			<%# creates a label object for the Order's name attribute, and what text you want to display %>
			<%= form.label :name, "Last Name:" %>
			<%= form.text_field :name, :size => 23, :default => @user.name %>
		</div>
		<%= clear_floats %>
		<br/>
		<div id = "user_address_field">
			<%= radio_button_tag "override_address", "no", :checked => true, :class => "radio_button" %>
			<b>Customer's Current Address:</b><br/>
			<p>
			<%=h @user.firstName+" "+@user.name %><br/>
			<%=h @user.address.street %> <%=h @user.address.streetNr %><br/>
			<%=h @user.address.zip %> <%=h @user.address.city %><br/>
			</p>
		</div>
		
		<div id="new_address_field">
			<div>
				<%= radio_button_tag "override_address", "yes"%>
				<b>Send to another address other than the Customer's address:</b>
				<%= clear_floats("left") %>
				<%# creates a label object for the Order's address attribute, and what text you want to display %>
				<%= form.label :street, "Street:" %>
				<%= form.text_field :street, :size => 23 %>
				<%= clear_floats("left") %>
			</div>
			
			<div>
				<%# creates a label object for the Order's address attribute, and what text you want to display %>
				<%= form.label :streetNr, "Street Number:" %>
				<%= form.text_field :streetNr, :size => 23 %>
				<%= clear_floats("left") %>
			</div>
			
			<div>
				<%# creates a label object for the Order's address attribute, and what text you want to display %>
				<%= form.label :city, "City:" %>
				<%= form.text_field :city, :size => 23 %>
				<%= clear_floats("left") %>
			</div>
			
			<div>
				<%# creates a label object for the Order's address attribute, and what text you want to display %>
				<%= form.label :zip, "Zip Code:" %>
				<%= form.text_field :zip, :size => 5 %>
				<%= clear_floats("left") %>
			</div>
		</div>
		
		<hr/>
		<div>
			<%# creates a label object for the Order's email attribute, and what text you want to display %>
			<%= form.label :email, "Email Address:" %>
			<%= form.text_field :email, :value => @user.email, :size => 46 %>
		</div>
		<%= clear_floats %>
		<div>
			<%# creates a label object for the Order's telephone attribute, and what text you want to display %>
			<%= form.label :telephone, "Telephone Number:" %>
			<%= form.text_field :telephone, :size => 20 %>
		</div>
		<%= clear_floats %>
		<div>
			<%# creates a label object for the Order's name attribute, and what text you want to display %>
			<%= form.label :pay_method, "Method of Payment:" %>
			<%# a dropdown select box, where the entries are those we specify in the Order.rb as Payment types %>
			<%= form.select :pay_method, Order::PAYMENT_TYPES, :prompt => "Select a payment method" %>
		</div>
		<%= clear_floats %>
		<div>
			
		</div>
		<%= clear_floats %>
		<%= submit_tag "Place Order", :class => "submit" %>
	</fieldset>
	<% end %>
</div>